//1.引入mysql模块
var mysql = require("mysql")

//2.创建连接对象
var conn = mysql.createConnection({
    //连接数据库的信息
    host: "127.0.0.1",
    user: "root",
    password: "root",
    database: "baixiu",
    multipleStatements: true  // 启用多条sql语句查询
})

//3.连接数据库
conn.connect()

//4.向外暴露连接的方法
module.exports = conn